//login.js
//获取应用实例
var app = getApp()
Page({
  data: {
    motto: '欢迎登录糖膳藏客户端',
    userInfo: {},
    userName: '',
    userPassword: '',
    id_token: '',
    responseData: '',
  },
  //事件处理函数
  bindViewTap: function () {
    wx.navigateTo({
      url: '../logs/logs'
    })
  },
  userNameInput: function (e) {
    this.setData({
      userName: e.detail.value
    })
  },
  userPasswordInput: function (e) {
    this.setData({
      userPassword: e.detail.value
    })
    console.log(e.detail.value)
  },
  logIn: function () {
    //var that = this
    wx.showToast({
      title: '登陆成功',
    })
    wx.redirectTo({
      url: '../patientdetail/patientdetail',
    })

  },
  onLoad: function () {
    console.log('onLoad')
    var that = this
    //调用应用实例的方法获取全局数据
    /*app.getUserInfo(function (userInfo) {
      //更新数据
      that.setData({
        userInfo: userInfo
      })
    })*/
  },
  onShow: function () {
    console.log('login is show')
  },
  onReady: function () {
    console.log('login is on ready')
  },
  onHide: function () {
    console.log('login is on hide')
  },
  onUnload: function () {
    console.log('login is on onload')
  },
  //分享函数
  onShareAppMessage: function () {
  }

})